home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_2 / update.csh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1995-11-14  |  7KB  |  138 lines

  1. #! /bin/csh
  2.  
  3. alias rm rm
  4. alias mv mv
  5.  
  6.  
  7. set n = 1
  8.  
  9. #
  10. # specify categories
  11. #
  12. echo ""
  13. rm dbase.tmp
  14. rm ../categories/*
  15. touch dbase.tmp
  16. foreach cats  ( `cat categories.txt` )
  17.  
  18. set catword  = $cats
  19.  
  20. nawk  -F^ ' BEGIN {  } \
  21. { \
  22. if ( $10 ~ /'"$catword"'/ ) print $0 \
  23. }' /var/opt/WWW/NCSA/htdocs/sunsoft/catlink/bin/dbase.isv >> /var/opt/WWW/NCSA/htdocs/sunsoft/catlink/bin/dbase.tmp
  24.  
  25.  
  26. #
  27. # make text page
  28. #
  29. echo "Creating text home page $catword..."
  30. echo " "
  31.  
  32. rm ../categories/$catword.txt.html
  33. set letter = "A"
  34.  
  35. cat head.html > ../categories/$catword.txt.html
  36. echo "<H1>$catword </H1>" >> ../categories/$catword.txt.html
  37. echo "</pre>" >> ../categories/$catword.txt.html
  38. echo "<DL>" >> ../categories/$catword.txt.html
  39.  
  40. echo '<B><FONT size="-1">' >> ../categories/$catword.txt.html
  41. echo '<B>Search for--</b><A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#A">A</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#B">B</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#C">C</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#D">D</A>' >> ../categories/$catword.txt.html
  42. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#E">E</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#F">F</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#G">G</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#H">H</A>' >> ../categories/$catword.txt.html
  43. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#I">I</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#J">J</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#K">K</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#L">L</A>' >> ../categories/$catword.txt.html
  44. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#M">M</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#N">N</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#O">O</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#P">P</A>' >> ../categories/$catword.txt.html
  45. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#Q">Q</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#R">R</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#S">S</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#T">T</A>' >> ../categories/$catword.txt.html
  46. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#U">U</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#V">V</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#W">W</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#X">X</A>' >> ../categories/$catword.txt.html
  47. echo '<A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#Y">Y</A> <A HREF="/sunsoft/catlink/categories/'$catword'.txt.html#Z">Z</A>' >> ../categories/$catword.txt.html
  48. echo '</FONT></B>' >> ../categories/$catword.txt.html
  49. echo '<hr>' >> ../categories/$catword.txt.html
  50. echo '<p>' >> ../categories/$catword.txt.html
  51.  
  52.  
  53. nawk -F^ ' BEGIN {i=65;s=0;letter ="^A.*";rletter = "A"} {\
  54. comp = $1;$7 = $1;href = gsub (/ /,"",$7) \
  55. if ( comp !~ letter ) {\
  56. for ( x=i;x<=100; ++x ){\
  57. letter = sprintf("^%c.*", x)\
  58. rletter = sprintf("%c", x)\
  59. if ( comp ~ letter ) {i=x;s=0;break}\
  60. }\
  61. }\
  62. if ( comp ~ letter && s==0 ) {\
  63. print "<DT><A NAME=\""rletter"\"><B><B>"rletter"</B></B></A><br><DD><a href=/cgi-bin/cat.pl/?"$7"+"$4"><B>"$1"</B></a>"$6"<br>";s=2 \
  64. }\
  65. if ( comp ~ letter && s==1) {\
  66. print "     <DD><a href=/cgi-bin/cat.pl/?"$7"+"$4"><B>"$1"</B></a>"$6"<br>"\
  67. }\
  68. s=1\
  69. }' dbase.tmp  >> ../categories/$catword.txt.html
  70.  
  71.  
  72. cat tail.html >> ../categories/$catword.txt.html 
  73.  
  74. rm dbase.tmp
  75. end
  76.  
  77.  
  78. # make main txt 
  79. echo " Making full txt list ..."
  80. echo "" 
  81.  
  82. cat head.html > ../categories/main.txt.html
  83. echo "<H1>Companies by name </H1>" >> ../categories/main.txt.html
  84. echo "</pre>" >> ../categories/main.txt.html
  85. echo "<DL>" >> ../categories/main.txt.html
  86. echo '<B><FONT size="-1">' >> ../categories/main.txt.html
  87. echo '<B>Search for--</b><A HREF="/sunsoft/catlink/categories/main.txt.html#A">A</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#B">B</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#C">C</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#D">D</A>' >> ../categories/main.txt.html
  88. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#E">E</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#F">F</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#G">G</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#H">H</A>' >> ../categories/main.txt.html
  89. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#I">I</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#J">J</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#K">K</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#L">L</A>' >> ../categories/main.txt.html
  90. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#M">M</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#N">N</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#O">O</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#P">P</A>' >> ../categories/main.txt.html
  91. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#Q">Q</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#R">R</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#S">S</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#T">T</A>' >> ../categories/main.txt.html
  92. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#U">U</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#V">V</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#W">W</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#X">X</A>' >> ../categories/main.txt.html
  93. echo '<A HREF="/sunsoft/catlink/categories/main.txt.html#Y">Y</A> <A HREF="/sunsoft/catlink/categories/main.txt.html#Z">Z</A>' >> ../categories/main.txt.html
  94. echo '</FONT></B>' >> ../categories/main.txt.html
  95. echo '<hr>' >> ../categories/main.txt.html
  96. echo '<p>' >> ../categories/main.txt.html
  97.  
  98. nawk -F^ ' BEGIN {i=65;s=0;letter ="^A.*";rletter = "A"} {\
  99. comp = $1;$7 = $1;href = gsub (/ /,"",$7) \
  100. if ( comp !~ letter ) {\
  101. for ( x=i;x<=100; ++x ){\
  102. letter = sprintf("^%c.*", x)\
  103. rletter = sprintf("%c", x)\
  104. if ( comp ~ letter ) {i=x;s=0;break}\
  105. }\
  106. }\
  107. if ( comp ~ letter && s==0 ) {\
  108. print "<DT><A NAME=\""rletter"\"><B>"rletter"</B></A><br><DD><a href=/cgi-bin/cat.pl/?"$7"+"$4"><B>"$1"</B></a>"$6"<br>";s=2 \
  109. }\
  110. if ( comp ~ letter && s==1) {\
  111. print "     <DD><a href=/cgi-bin/cat.pl/?"$7"+"$4"><B>"$1"</B></a>"$6"<br>"\
  112. }\
  113. s=1\
  114. }' dbase.isv  >> ../categories/main.txt.html
  115.  
  116. cat tail.html >> ../categories/main.txt.html
  117.  
  118.  
  119.  
  120. #
  121. # Prepare report directory for push
  122. #
  123.  
  124. rm -f /var/opt/WWW/NCSA/htdocs/sunsoft/catlink/report/lstwk*
  125. rm -f /var/opt/WWW/NCSA/htdocs/sunsoft/catlink/report/testisv*
  126.  
  127. touch /var/opt/WWW/NCSA/htdocs/sunsoft/catlink/report/testisv.html
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. exit 0
  138.